package com.jtx.miaoah2.Cache;

import com.jtx.miaoah2.Common.RedisConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;

/**
 * @author 季台星
 * @Date 2023 07 23 18 12
 */
@Component
public class BlankUserCache {
    @Autowired
    private StringRedisTemplate redisTemplate;
    public boolean isExist(Long userId){
        return redisTemplate.opsForHash().hasKey(RedisConstants.BLANK_USER, userId.toString());
    }

    public void addBlankUser(Long userId) {
        redisTemplate.opsForHash().put(RedisConstants.BLANK_USER, userId, " ");
    }
}
